<div class="panel panel-box">
    <div class="panel-heading">
        <div class="titleimage">
            <h3 class="panel-title panel-title-font">
                <?php echo yii::t('models/News','Image Content News')?>
                <a href="<?php echo yii::app()->baseUrl.'/display/imagecontentnews'?>"><span class="pull-right fontcolor">+更多</span></a>
            </h3>
        </div>
    </div>
    <?php if($this->homePage):?>
    <div class="panel-body" style="padding:5px;">
        <div class="row">
            <?php for($j = 0;$j < 3;$j++):?>
            <?php if($this->imageContentNews[$j] === null):?>
            <?php break;?>
            <?php endif;?>
            <div class="col-md-4 col-xs-4 col-sm-4 col-lg-4">
                <div class="thumbnail" style="margin-bottom:0px">
                <a href="<?php echo yii::app()->baseUrl.'/display/news/'.$this->imageContentNews[$j]->news_id?>">
                    <img src="<?php echo '/'.$this->imageContentNews[$j]->url;?>" alt="image"/>
                    <h4 style="text-align:center"><?php echo $this->imageContentNews[$j]->title;?></h4>
                </a>
                </div>
            </div>
            <?php endfor;?>
        </div>
   </div>
    <?php else:?>
    <div class="panel-body" style="padding:5px;">
            <?php $index = 0;for($i = 0;$i < ($this->DISPLAY_NUMBER-1)/3 + 1;$i++):?>
        <div class="row">
            <?php for($j = 0;$j < 3 && $index < $this->DISPLAY_NUMBER;$j++):?>
            <?php if(!isset($this->imageContentNews[$index])):?>
            <?php break;?>
            <?php endif;?>
            <div class="col-md-4 col-xs-4 col-sm-4 col-lg-4">
                <div class="thumbnail"style="margin-bottom:0px">
                <a href="<?php echo yii::app()->baseUrl.'/display/news/'.$this->imageContentNews[$index]->news_id?>">
                    <img src="<?php echo '/'.$this->imageContentNews[$index]->url;?>" alt="image"/>
                    <h4 style="text-align:center"><?php echo $this->imageContentNews[$index]->title;?></h4>
                </a>
                </div>
            </div>
            <?php $index++;?>
            <?php endfor;?>
        </div>
            <?php endfor;?>
   </div>
    <?php endif;?>
</div>
